﻿using System;

namespace _6
{
    class Program
    {
        static void Main(string[] args)
        {
            int sum=0;
            for (int i = 1; i <=20; i++)
            {
                sum += Fib(i);
            }
            Console.WriteLine($"前20项的和:{sum}");
        }

        private static int Fib(int i)
        {
            if (i == 1 || i == 2)
            {
                return 1;
            }
            else
            {
                return Fib(i - 1) + Fib(i - 2);
            }
        }
    }
}
